import { env } from "@/utils/env";
import { stringify } from "qs";
import http from "./http";
import type { User } from "@/types/User";
import { type ResponeData } from "@/types/HttpType";
;

export const login = async (data: any): Promise<ResponeData<string>> => {
  return await http<string>({
    url: env.VITE_JIANCAI + "/user/login",
    method: "post",
    data,
  });
};

export const logout = async (): Promise<ResponeData<User>> => {
  return await http<User>({
    url: env.VITE_JIANCAI + "/user/logout",
    method: "post",
  });
};
